< previous page page_168 next page >

Page 168
This example is from the For/Next Step 2 command button:
9f31265bb40b592b1929e18a47ab28e5.gif
Private Sub cmdForStep2_Click ()
   Dim intLoop As Integer

   Cls
   For intLoop = 5 To 50 Step 5
      Print intLoop
   Next intLoop
End Sub
9f31265bb40b592b1929e18a47ab28e5.gif
TIP
Putting the variable name after the
Next statement is sometimes more efficient and more readable than using Next by itself.
The For . . . Next Example
Lets write some code thats very typical in a real-world situation. Remember the email form you created in Chapter 5? Lets add a list box to that form of mailing addresses for people you would send email to. Make this list box a multiselect list box so that you can send email to multiple people. After you make your selections, you can transfer the list of names to the To text box. See Figure 8.4 for an example of what this form should look like.
8160-0168a.gif
Figure 8.4
Email with transfer capability.
Examples Filename: Email.frm

 
< previous page page_168 next page >

If you like this book, buy it!